import img404 from '@/assets/error.png'


const users = [
    {
      title: '编号',
      dataIndex: 'id',
      sorter:true
    },
    {
      title: '照片',
      dataIndex: 'cover',
      width:120,
      render: cover => {
        return <img src={cover || img404} width={40} height={40} alt="" />
      }
    },
    {
      title: '账号',
      dataIndex: 'username'
    },
    {
      title: '姓名',
      dataIndex: 'realname'
    },
    {
      title: '创建时间',
      dataIndex: 'create_at',
      sorter:true
    }
  ]


  const college = [
    {
      title: '编号',
      dataIndex: 'id'
    },
    {
      title: '学院名称',
      dataIndex: 'name'
    },
    {
      title: '学院编码',
      dataIndex: 'code'
    },
    {
      title: '创建时间',
      dataIndex: 'create_time'
    },
    {
      title: '更新时间',
      dataIndex: 'update_time'
    },
    {
      title: '备注',
      dataIndex: 'remark'
    }
  ]

  const specialty = [
    {
      title: '编号',
      dataIndex: 'id'
    },
    {
      title: '专业名称',
      dataIndex: 'name'
    },
    {
      title: '专业编码',
      dataIndex: 'code'
    },
    {
      title: '创建时间',
      dataIndex: 'create_time'
    },
    {
      title: '更新时间',
      dataIndex: 'update_time'
    },
    {
      title: '备注',
      dataIndex: 'remark'
    }
  ]

  const course = [
    {
      title: '编号',
      dataIndex: 'id'
    },
    {
      title: '课程名称',
      dataIndex: 'name'
    },
    {
      title: '课程编码',
      dataIndex: 'code'
    },
    {
      title: '创建时间',
      dataIndex: 'create_time'
    },
    {
      title: '更新时间',
      dataIndex: 'update_time'
    },
    {
      title: '备注',
      dataIndex: 'remark'
    }
  ]

  const student = [
    {
      title: '编号',
      dataIndex: 'id'
    },
    {
      title: '学号',
      dataIndex: 'student_no'
    },
    {
      title: '姓名',
      dataIndex: 'name'
    },
    {
      title: '性别',
      dataIndex: 'gender'
    },
    {
      title: '学院名称',
      dataIndex: 'college_name'
    },
    {
      title: '专业名称',
      dataIndex: 'specialty_name'
    },
    {
      title: '邮箱',
      dataIndex: 'email'
    },
    {
      title: '出生日期',
      dataIndex: 'birthday'
    }

    // {
    //   title: '创建时间',
    //   dataIndex: 'create_time'
    // },
    // {
    //   title: '更新时间',
    //   dataIndex: 'update_time'
    // }
  ]

  const teacher = [
    {
      title: '编号',
      dataIndex: 'id'
    },
    {
      title: '工号',
      dataIndex: 'teacher_no'
    },
    {
      title: '姓名',
      dataIndex: 'name'
    },
    {
      title: '性别',
      dataIndex: 'gender'
    },
    {
      title: '学院名称',
      dataIndex: 'college_name'
    },
    {
      title: '邮箱',
      dataIndex: 'email'
    },
    {
      title: '出生日期',
      dataIndex: 'birthday'
    }

    // {
    //   title: '创建时间',
    //   dataIndex: 'create_time'
    // },
    // {
    //   title: '更新时间',
    //   dataIndex: 'update_time'
    // }
  ]


  const manager = [
    {
      title: '编号',
      dataIndex: 'id'
    },
    {
      title: '账号',
      dataIndex: 'account'
    },
    {
      title: '姓名',
      dataIndex: 'name'
    },
    {
      title: '邮箱',
      dataIndex: 'email'
    },
    {
      title: '创建时间',
      dataIndex: 'create_time'
    },
    {
      title: '更新时间',
      dataIndex: 'update_time'
    }
  ]


  const question_bank = [
    {
      title: '编号',
      dataIndex: 'id'
    },
    {
      title: '题目',
      dataIndex: 'subject'
    },
    {
      title: '课程名称',
      dataIndex: 'course_name'
    },
    {
      title: '难度等级',
      dataIndex: 'difficulty_level_name'
    },
    {
      title: '题型',
      dataIndex: 'subject_type_name'
    }

    // {
    //   title: '创建时间',
    //   dataIndex: 'create_time'
    // },
    // {
    //   title: '更新时间',
    //   dataIndex: 'update_time'
    // }
  ]

const article = [
    {
      title: '封面',
      dataIndex: 'cover',
      width: 120,
      render: cover => {
        return <img src={cover.images[0] || img404} width={80} height={60} alt="" />
      }
    },
    {
      title: '标题',
      dataIndex: 'title',
      width: 220
    },
    {
      title: '状态',
      dataIndex: 'status',
      render: data => {
        return data === 1? "审核失败":"审核成功"
      }
    },
    {
      title: '发布时间',
      dataIndex: 'pubdate'
    },
    {
      title: '阅读数',
      dataIndex: 'read_count'
    },
    {
      title: '评论数',
      dataIndex: 'comment_count'
    },
    {
      title: '点赞数',
      dataIndex: 'like_count'
    }
]

const exam_paper = [
  {
    title: '编号',
    dataIndex: 'id'
  },
  {
    title: '试卷名称',
    dataIndex: 'name'
  },
  {
    title: '课程名称',
    dataIndex: 'course_name'
  },
  // {
  //   title: '试题',
  //   dataIndex: 'exam_questions'
  // },
  {
    title: '创建时间',
    dataIndex: 'create_time'
  }
]

const student_score = [
  {
    title: '编号',
    dataIndex: 'id'
  },
  {
    title: '试卷名称',
    dataIndex: 'exam_paper_name'
  },
  {
    title: '课程名称',
    dataIndex: 'course_name'
  },
  {
    title: '  客观题分数',
    dataIndex: 'objective_score'
  },
  {
    title: '  主观题分数',
    dataIndex: 'questions_score'
  },
  {
    title: '总分',
    dataIndex: 'score'
  }
]

const mark_papers = [
  {
    title: '编号',
    dataIndex: 'id'
  },
  {
    title: '试卷名称',
    dataIndex: 'exam_paper_name'
  },
  {
    title: '课程名称',
    dataIndex: 'course_name'
  },
  {
    title: '学生姓名',
    dataIndex: 'student_name'
  },
  {
    title: '  评阅教师',
    dataIndex: 'teacher_name'
  }
]

export const columns = {
    users,
    college,
    specialty,
    course,
    student,
    teacher,
    manager,
    question_bank,
    article,
    exam_paper,
    student_score,
    mark_papers
}